#include <iostream>
#include <string>
#include <unordered_set>
using namespace std;
unordered_set<char> num_ = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
unordered_set<char> op_ = {'+', '-', '*', '/'};
unordered_set<char> left_ = {'(', '[', '{'};
unordered_set<char> right_ = {')', ']', '}'};
double nums[1000];
char ops[1000];
int cur_nums;
int cur_ops;
string s;

bool gao(char c1, char c2) {
    if (left_.count(c1)) return 1;
    if (c1 == '*' || c1 == '/') return 0;
    if ((c1 == '+' || c1 == '-') && (c2 == '*' || c2 == '/')) return 1;
    return 0;
}

double cal(double num1, double num2, char op) {
    if (op == '+')
        return num1 + num2;
    else if (op == '-')
        return num1 - num2;
    else if (op == '*')
        return num1 * num2;
    else if (op == '/')
        return num1 / num2;
    else {
        cout << "cal wrong" << endl;
        cout << num1 << "  " << num2 << "  " << op << endl;
        return 0;
    }
}

int main() {
    cin >> s;
    for (int i = 0; i < s.length(); i++) {
        if (num_.count(s[i])) {
            int j = i;
            while (j < s.length() && num_.count(s[j])) j++;
            nums[cur_nums++] = stod(s.substr(i, j - i));
            i = j - 1;
            continue;
        } else if (op_.count(s[i])) {
            if (i - 1 < 0 ||
                (!num_.count(s[i - 1]) && !right_.count(s[i - 1]))) {
                int j = i + 1;
                while (j < s.length() && num_.count(s[j])) j++;
                nums[cur_nums++] = stod(s.substr(i, j - i));
                i = j - 1;
                continue;
            }
            if (cur_ops == 0)
                ops[cur_ops++] = s[i];
            else if (gao(ops[cur_ops - 1], s[i]))
                ops[cur_ops++] = s[i];
            else {
                while (cur_ops != 0 && !gao(ops[cur_ops - 1], s[i])) {
                    double n2 = nums[--cur_nums];
                    double n1 = nums[--cur_nums];
                    nums[cur_nums++] = cal(n1, n2, ops[--cur_ops]);
                }
                ops[cur_ops++] = s[i];
            }
        } else if (left_.count(s[i])) {
            ops[cur_ops++] = s[i];
        } else if (right_.count(s[i])) {
            while (!left_.count(ops[cur_ops - 1])) {
                double n2 = nums[--cur_nums];
                double n1 = nums[--cur_nums];
                nums[cur_nums++] = cal(n1, n2, ops[--cur_ops]);
            }
            cur_ops--;
        } else {
            cout << "for xun huan cuo le" << endl;
        }
    }
    while (cur_ops != 0) {
        double n2 = nums[--cur_nums];
        double n1 = nums[--cur_nums];
        nums[cur_nums++] = cal(n1, n2, ops[--cur_ops]);
    }
    cout << nums[cur_nums - 1] << endl;
    return 0;
}